package database_interaction;

import java.util.ArrayList;
import java.util.List;

/**
 * @file ParameterList.java
 * @version 0.1
 * @author James Dibble 10009689
 */
public class ParameterList {
    // <editor-fold defaultstate="collapsed" desc="Attributes">
    private List<Parameter> _parms;
    private List<String> _columns;
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Constructors">
    public ParameterList() {
        _parms = new ArrayList<>();
        _columns = new ArrayList<>();
    }
    
    public ParameterList(List<Parameter> parms, String[] columns) throws JDBCException{
        if(_parms.size() != columns.length) throw new JDBCException("Number of parameters does not match number of columns.");
        _parms = parms;
         _columns = new ArrayList<>();
         for(String thisCol: columns){
             _columns.add(thisCol);
         }
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public List<Parameter> getParms(){
        return _parms;
    }
    
    public List<String> getColumns(){
        return _columns;
    }
    
    public void addParameter(Parameter parm){
        this._parms.add(parm);
    }
    
    public void addColumn(String columnName){
        this._columns.add(columnName);
    }
    // </editor-fold>
}
